/***************************************************************************
 *   Copyright (C) 2008 by Eduardo Gurgel Pinho                            *
 *   edgurgel@gmail.com                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/

#ifndef __MATERIAL_PANEL_H__
#define __MATERIAL_PANEL_H__

#include <QWidget>
#include "object/object.h"
#include "material/material.h"

class QLabel;
class QDoubleSpinBox;
class QPushButton;
class QVBoxLayout;
class QHBoxLayout;
class QMouseEvent;
class QMenu;

namespace Ui {

class Color_Widget;
	
	/**
	 * This class needs to be rewritten;
	 */
	
class Material_Panel : public QWidget {

Q_OBJECT

public:
	Material_Panel(QWidget* _parent = 0);
	~Material_Panel(void);
		
	QSize minimumSizeHint() const;
	
	void clear(void);
	
public slots:
	void select_material(Sirat::Material::Material* _material);
	void select_object(Sirat::Object::Object* _object);
	void color_material(void);
	void texture_material(void);
			
private slots:
	void update_material(void);
	
private:
	QPushButton* change_button;
	QMenu* change_menu;
	
	QLabel** object_text;
	Color_Widget* object_colors[4];
	
	QLabel* brightness_label;
	QDoubleSpinBox* brightness_spinbox;
	
	Color_Widget* light_color;
	QLabel* light_text;
	
	QLabel* energy_label;
	QDoubleSpinBox* energy_spinbox;
	
	QLabel* texture_text;
	QLabel* texture_image;

	Sirat::Material::Material* material;
	Sirat::Object::Object* workaround;
};

}

#endif
